package com.crm.business.crm.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.crm.business.crm.mapper.BillNoticeMapper;
import com.crm.business.crm.service.BillNoticeService;
import com.crm.business.servlet.BaseServiceImpl;
import com.crm.common.crm.entity.PO.BillNotice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BillNoticeServiceImpl extends BaseServiceImpl<BillNoticeMapper, BillNotice> implements BillNoticeService {

    @Autowired
    private BillNoticeMapper billNoticeMapper;

    @Override
    public BillNotice getNew(){
        QueryWrapper<BillNotice> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("notice_type","1").eq("status","1").orderByDesc("id").last(" limit 1 ");
        BillNotice notice = getBaseMapper().selectOne(queryWrapper);
        return notice;
    }
}
